<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\models\system\Auth */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="auth-form">

    <?php $form = ActiveForm::begin([
        'options' => [
            'class'=>"form-horizontal",
            'onkeydown' => "if(event.keyCode==13)return false;",
        ],
        'id' => 'create_update_form',
    ]); ?>

    <div class="panel panel-default">
        <div class="panel-body">
            <div class="row">
                <label class="col-sm-2 control-label"><span class="red">*</span>角色名称</label>
                <div class="col-xs-9 col-sm-3">
                    <?=$form->field($model, 'name')->textInput(['class'=>'form-control col-md-2'])->label(false); ?>
                </div>
            </div>
            <div class="row">
                <label class="col-sm-2 control-label"><span class="red">*</span>角色描述</label>
                <div class="col-xs-9 col-sm-3">
                    <?=$form->field($model, 'description')->textInput(['class'=>'form-control col-md-2'])->label(false);?>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-offset-2 col-sm-10">
            <div class="form-group">
                <?= Html::submitButton('保 存', ['class' => 'btn btn-success btn-lg ajax-post','target-form'=>'form-horizontal']) ?>
            </div>
        </div>
    </div>
    <?php ActiveForm::end(); ?>

</div>

<script language="JavaScript">
    <?php $this->beginBlock(Yii::$app->controller->route) ?>

    jQuery(document).ready(function() {
        highlight_subnav('system/auth/index'); //子导航高亮
    });

    <?php
    $this->endBlock();
    $this->registerJs($this->blocks[Yii::$app->controller->route], \yii\web\View::POS_END);
    ?>
</script>
